/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.pa165.machineryrental.dto;

import java.util.List;

/**
 *
 * @author David Katuscak, 359273
 */
public class CustomerDTO {
    
    /**
     * Unique id
     */
    private long id;
    
    /**
     * Contains first name of customer
     */    
    private String firstName;
    
    /**
     * Contains last name of customer
     */
    private String lastName;
    
    /**
     * Contains email of customer. Email is unique.
     */
    private String email;
    
    /**
     * List of all rentals of customer.
     */
    private List<RentalDTO> rentals;
    
    /**
     * Customers phone number.
     */
    private String phone;
    
    /**
     * Street.
     */
    private String street;
	
	 /**
     * City.
     */
    private String city;
	
	/**
     * Zip code.
     */
    private String zipCode;
	
	/**
     * Country.
     */
    private String country;
    
    /**
     * Type of customer.
     */
    private CustomerType customerType;
    
    /**
     * Value added tax identification number of customer.
     */
    private String vatNumber;
    
    /**
     * Customers company number.
     */
    private String companyNumber;
    
    /**
     * Return identifier of rental
     * @return Identifier of rental
     */
    public long getId() {
        return id;
    }

    /**
     * Sets given id.
     * @param id Id of rental
     */
    public void setId(long id) {
        this.id = id;
    }
    
    
    /**
     * @return firstname of the customer
     */
    public String getFirstName() {
        return firstName;
    }

    /**
     * Sets firstName of the customer
     * @param firstName 
     */
    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }
    
    /**
     * 
     * @return lastname of the customer
     */
    public String getLastName() {
        return lastName;
    }

    /**
     * Sets lastname of the customer
     * @param lastName 
     */
    public void setLastName(String lastName) {
        this.lastName = lastName;
    }
    
    /**
     * 
     * @return email of the customer (email should be unique)
     */
    public String getEmail() {
        return email;
    }

    /**
     * Sets an email of the customer
     * @param email 
     */
    public void setEmail(String email) {
        this.email = email;
    }
    
    /**
     * @return List of rentals of the customer
     */
    public List<RentalDTO> getRentals() {
        return rentals;
    }

    /**
     * Sets the List of rentals of the customer
     * @param rentals 
     */
    public void setRentals(List<RentalDTO> rentals) {
        this.rentals = rentals;
    }
    
    /**
     * 
     * @return phone number of the customer
     */
    public String getPhone() {
        return phone;
    }

    /**
     * Sets phone number of the customer
     * @param phone 
     */
    public void setPhone(String phone) {
        this.phone = phone;
    }
    
    /**
     * @return type of the customer
     */
    public CustomerType getCustomerType() {
        return customerType;
    }

    /**
     * Sets type of the customer to the customer
     * @param customerType 
     */
    public void setCustomerType(CustomerType customerType) {
        this.customerType = customerType;
    }
    
    /**
     * @return VAT number of the customer
     */
    public String getVatNumber() {
        return vatNumber;
    }

    /**
     * Sets VAT number of the customer
     * @param vatNumber 
     */
    public void setVatNumber(String vatNumber) {
        this.vatNumber = vatNumber;
    }
    
    /**
     * @return Company number of the customer if exist
     */
    public String getCompanyNumber() {
        return companyNumber;
    }

    /**
     * Sets company number of the customer
     * @param companyNumber 
     */
    public void setCompanyNumber(String companyNumber) {
        this.companyNumber = companyNumber;
    }

	/**
	 * Returns street
	 * @return Street of customer address
	 */
	public String getStreet() {
		return street;
	}

	/**
	 * Sets street
	 * @param street Street name
	 */
	public void setStreet(String street) {
		this.street = street;
	}

	/**
	 * Returns customer city name
	 * @return customers city name
	 */
	public String getCity() {
		return city;
	}

	/**
	 * Sets customer's city name
	 * @param city City name
	 */
	public void setCity(String city) {
		this.city = city;
	}

	/**
	 * Returns Zip code of customer address
	 * @return Zip Code
	 */
	public String getZipCode() {
		return zipCode;
	}

	/**
	 * Sets zip code
	 * @param zipCode Zip code
	 */
	public void setZipCode(String zipCode) {
		this.zipCode = zipCode;
	}

	/**
	 * Sets country, where customer live
	 * @return Country name
	 */
	public String getCountry() {
		return country;
	}

	/**
	 * Returns country, where customer lives
	 * @param country 
	 */
	public void setCountry(String country) {
		this.country = country;
	}
	
	
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + (int) (id ^ (id >>> 32));
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (!(obj instanceof CustomerDTO)) {
            return false;
        }
        CustomerDTO other = (CustomerDTO) obj;
        return id == other.id;
    }

    @Override
    public String toString() {
        return "CustomerDTO [\nid=" + id + "\nfirstName=" + firstName + "\nlastName=" + lastName 
                + "\nemail=" + email + "\nphone=" + phone 
                + "\ncustomerType=" + customerType + "\nvatNumber=" + vatNumber 
                + "\ncompanyNumber=" + companyNumber + "\ncustomerType=" + customerType + "\n]";
    }

}
